<?php 
namespace app\admin\validate;
use app\admin\code\AdminCode;
use app\admin\code\AuthCode;
use app\admin\code\BaseCode;
use app\admin\model\BaseModel;
use think\Validate;

class ArticleValidate extends BaseValidate
{
    protected $_rule = [
        'id'       =>  'require',
        'name'     =>  'require|max:10',
        'value'    =>  'require',
    ];
    protected $_field = [
        'id'=>'文章',
        'name'=>'标题',
        'value'=>'文章内容',
    ];
    protected $_message = [
        'id.require' => BaseCode::PARAM_CANT_EMPTY,
        'name.require' => BaseCode::PARAM_CANT_EMPTY,
        'name.max' => BaseCode::PARAM_MAX,
        'value.require' => BaseCode::PARAM_CANT_EMPTY,
    ];
    protected $_scene = [
        'update' => ['id','name','value'],
        'add'    => ['name','value'],
        'del' => ['id'],
    ];
}


